const { ref, defineEmits } = Vue

export default {
    emits: ['change'],
    setup(props, { emit }) {
        const isAllChecked = ref(false)

        const toggleAll = () => {
            isAllChecked.value = !isAllChecked.value
            emit('change', isAllChecked.value)
        }

        return {
            isAllChecked,
            toggleAll
        }
    },
    template: `#selectall`
}